package com.wzcl.app.dao.model;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author beingven
 * @Description TODO
 * @createTime 2020年12月10日 16:00:00
 */
@Getter
@Setter
@Table(name = "work_show")
@Entity
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class WorkShow implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty("作品秀")
    private String image;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("获赞数")
    @Column(name = "like_number")
    private Integer likeNumber;

    @ApiModelProperty("虚拟获赞数")
    @Column(name = "virtual_like_number")
    private Integer virtualLikeNumber;

    @ApiModelProperty("虚拟点赞用户集合")
    @Column(name = "virtual_like_of_person")
    private String virtualLikeOfPerson;

    @ApiModelProperty("哪些人点了赞,通过字符串追加的方式记录")
    private String likeOfPerson;

    @ApiModelProperty("用户点赞头像集合")
    private String likeIconList;

    @ApiModelProperty("是否已被老师点评：0未点评 1已点评")
    private Integer isComment;

    @ApiModelProperty("是否推送")
    private Integer pushStatus;

    @ApiModelProperty("作品秀审核状态（0未审核 1已通过 2驳回）")
    private Integer checkStatus;

    @OneToOne(mappedBy = "workShow")
    private  WorkShowReviews workShowReviews;

    @ManyToOne(cascade={CascadeType.ALL},
            fetch=FetchType.EAGER,optional=false)
    @JoinColumn(name = "catalog_id")
    private EssayCourseCatalog catalog;

    @ManyToOne
    @JoinColumn(name = "course_id")
    private Course course;

    @ManyToOne(cascade={CascadeType.ALL},
            fetch=FetchType.EAGER,optional=false)
    @JoinColumn(name = "user_id")
    private AppUser appUser;
}
